<!DOCTYPE html>
<html>
<head>
    <title>登录</title>
    <meta name="keywords" content="轻课网,数据分析,网站开发,移动开发,安卓开发,编程教程,技术教程,公开课,在线课程">
    <meta name="robots" content="noodp"/>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/png" href="assets/i/favicon.png">
    <link rel="stylesheet" href="assets/css/font-awesome.css">
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/application.css" type="text/css">
    <link rel="stylesheet" href="assets/css/auth.css" type="text/css">
    <link rel="stylesheet" href="assets/css/build2.css">
    <link rel="stylesheet" href="assets/css/layer-animate.css">
    <link rel="stylesheet" href="assets/css/nprogress.css">
</head>
<!--<body class="page-auth" ondragstart="window.event.returnValue=false" oncontextmenu="window.event.returnValue=false" onselectstart="event.returnValue=false">-->
<body class="page-auth">
<div class="clear header" style="padding: 16px 0 0 0; margin-bottom: 0;">
    <a href="./login.html" class="start">
        <img src="assets/img/logoc.png" alt="">
        <span>轻课网学习平台</span>
    </a>
</div>
<div class="container">
    <div class="tabbed-pane" id="auth-container">
        <div class="content">
            <div class="form-header">帐号登录</div>
            <div class="form-description">使用轻课网帐号登录“我的教室”，学习课程、提交项目并获得所有学习资源！</div>
            <div class="form">
                <div class="form-group">
                    <input class="text_input" tabIndex="1" type="text" placeholder="账号">
                </div>
                <div class="form-group">
                    <input  class="password" tabIndex="2" type="password" placeholder="密码">
                </div>
            </div>
            <div class="row">
                <div class="radio col-lg-3" id="student_radio">
                    <input type="radio" name="radio1" id="radio1" value="option1" checked>
                    <label for="radio1" class="currency_radio">学生</label>
                </div>
                <div class="radio col-lg-3" id="teacher_radio">
                    <input type="radio" name="radio1" id="radio2" value="option2">
                    <label for="radio2" class="currency_radio">游客</label>
                </div>
            </div>
            <div class="row">
                <div class="checkbox col-lg-4">
                    <input type="checkbox" name="checkbox" id="checkbox" value="checkbox">
                    <label for="checkbox" id="label_checked">记住密码</label>
                </div>
            </div>
            <button id="btn_submit" type="submit" class="btn btn-primary center" style="cursor: pointer;">登录</button>
            <div id="myModal8" class="modal" aria-hidden="true" data-backdrop="static" data-easein="expandIn" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h4 class="modal-title">注册游客账号</h4>
                        </div>
                        <div class="modal-body">
                            <form id="registForm" class="form-horizontal bv-form">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label control-label_add">
                                        用户名(账号)
                                    </label>
                                    <div class="col-sm-8">
                                        <input type="text" class="form-control control_add" id="new_userName" name="username" placeholder="请输入用户名">
                                        <i class="form-control-feedback username_i" style="display: none;"></i>
                                        <small class="help-block help-block1" style="display: none;">用户名(账号)不能为空</small>
                                        <small class="help-block help-block2" style="display: none;">用户名(账号)必须是您的名字</small>
                                        <small class="help-block help-block4" style="display: none;">该用户名(账号)已存在</small>
                                        <div id="result"></div>
                                    </div>
                                </div>
                                <div class="form-group has-feedback">
                                    <label class="col-sm-3 control-label control-label_add">
                                        电话号码(密码)
                                    </label>
                                    <div class="col-sm-8">
                                        <input class="form-control control_add" type="password" id="phone" name="phone" placeholder="请输入手机号码">
                                        <i class="form-control-feedback phone_i" style="display: none;"></i>
                                        <small class="help-block phone_block1" style="display: none;">手机号(密码)不能为空</small>
                                        <small class="help-block phone_block2" style="display: none;">手机号(密码)格式错误</small>
                                    </div>
                                </div>
                                <div class="form-group has-feedback">
                                    <label for="repwd" class="col-sm-3 control-label control-label_add">
                                        确认密码
                                    </label>
                                    <div class="col-sm-8">
                                        <input class="form-control control_add" type="password" id="repwd" name="repwd" placeholder="请确认密码" data-bv-field="repwd">
                                        <i class="form-control-feedback repwd_i" style="display: none;"></i>
                                        <small class="help-block repwd_block1" style="display: none;">确认密码不能为空</small>
                                        <small class="help-block repwd_block2" style="display: none;">两次输入的密码不一致</small>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button class="btn_add btn-default btn-default_add" data-dismiss="modal" aria-hidden="true">关闭</button>
                            <button id="register_button" class="btn_add btn-info">注册</button>
                        </div>
                    </div>
                </div>
            </div>
            <br><a href="#myModal8" role="button" data-toggle="modal" id="register">注册游客账号</a>
        </div>
    </div>
</div>
</body>
</html>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/js/student.js"></script>
<script src="assets/js/method.js"></script>
<script src="assets/js/nprogress.js"></script>
<script src="assets/js/velocity.min.js"></script>
<script src="assets/js/velocity.ui.min.js"></script>
<script type="text/javascript">
    // add the animation to the popover
    $('a[rel=popover]').popover().click(function(e) {
        e.preventDefault();
        var open = $(this).attr('data-easein');
        if (open == 'shake') {
            $(this).next().velocity('callout.' + open);
        } else if (open == 'pulse') {
            $(this).next().velocity('callout.' + open);
        } else if (open == 'tada') {
            $(this).next().velocity('callout.' + open);
        } else if (open == 'flash') {
            $(this).next().velocity('callout.' + open);
        } else if (open == 'bounce') {
            $(this).next().velocity('callout.' + open);
        } else if (open == 'swing') {
            $(this).next().velocity('callout.' + open);
        } else {
            $(this).next().velocity('transition.' + open);
        }

    });
    // add the animation to the modal
    $(".modal").each(function(index) {
        $(this).on('show.bs.modal', function(e) {
            var open = $(this).attr('data-easein');
            if (open == 'shake') {
                $('.modal-dialog').velocity('callout.' + open);
            } else if (open == 'pulse') {
                $('.modal-dialog').velocity('callout.' + open);
            } else if (open == 'tada') {
                $('.modal-dialog').velocity('callout.' + open);
            } else if (open == 'flash') {
                $('.modal-dialog').velocity('callout.' + open);
            } else if (open == 'bounce') {
                $('.modal-dialog').velocity('callout.' + open);
            } else if (open == 'swing') {
                $('.modal-dialog').velocity('callout.' + open);
            } else {
                $('.modal-dialog').velocity('transition.' + open);
            }

        });
    });
</script>
<script>
    $(document).ready(function () {
        var new_userName,
            new_phone,
            new_password,
            new_array = [];
        //输入姓名
        $('#new_userName').bind('input propertychange', function() {
            $('.help-block1').css('display' , 'none');
            $('.help-block2').css('display' , 'none');
            $('.help-block3').css('display' , 'none');
            $('.help-block4').css('display' , 'none');
            $(this).parent().parent().removeClass('has-error');
            $(this).parent().parent().removeClass('has-success');
            if($(this).val().length == '0'){
                $('.help-block1').css('display' , 'block');
                $(this).parent().parent().addClass('has-error');
                $('.username_i').css('display' , 'block');
                $(this).keydown(function(){
                    $('.username_i').css('color' , '#4A708B');
                    $('.username_i').removeClass('QK1 QK-cuohao QK-duihao-copy');
                    $('.username_i').addClass('QK1 QK-f14');
                });
                $(this).keyup(function(){
                    $('.username_i').css('color' , '#a94442');
                    $('.username_i').removeClass('QK1 QK-f14 QK-duihao-copy');
                    $('.username_i').addClass('QK1 QK-cuohao');
                });
            }
            if($(this).val().length != '0'){
                var str =$(this).val();
                //判断是否含有汉字
                if(/.*[\u4e00-\u9fa5]+.*$/.test(str)) {
//                    console.log('汉字');
                    $(this).parent().parent().addClass('has-success');
                    $('.username_i').css('display' , 'block');
                    $(this).keydown(function(){
                        $('.username_i').css('color' , '#4A708B');
                        $('.username_i').removeClass('QK1 QK-cuohao QK-duihao-copy');
                        $('.username_i').addClass('QK1 QK-f14');
                    });
                    $(this).keyup(function(){
                        $('.username_i').css('color' , '#3c763d');
                        $('.username_i').removeClass('QK1 QK-f14 QK-cuohao');
                        $('.username_i').addClass('QK1 QK-duihao-copy');
                    });
                }else{
                    $('.help-block2').css('display' , 'block');
                    $(this).parent().parent().addClass('has-error');
                    $('.username_i').css('display' , 'block');
                    $(this).keydown(function(){
                        $('.username_i').css('color' , '#4A708B');
                        $('.username_i').removeClass('QK1 QK-cuohao QK-duihao-copy');
                        $('.username_i').addClass('QK1 QK-f14');
                    });
                    $(this).keyup(function(){
                        $('.username_i').css('color' , '#a94442');
                        $('.username_i').removeClass('QK1 QK-f14 QK-duihao-copy');
                        $('.username_i').addClass('QK1 QK-cuohao');
                    });
                }
            }
        });
        //输入电话号
        $('#phone').bind('input propertychange', function() {
            $('.phone_block1').css('display' , 'none');
            $('.phone_block2').css('display' , 'none');
            $(this).parent().parent().removeClass('has-error');
            $(this).parent().parent().removeClass('has-success');
            if($(this).val().length == '0'){
                $('.phone_block1').css('display' , 'block');
                $(this).parent().parent().addClass('has-error');
                $('.phone_i').css('display' , 'block');
                $(this).keydown(function(){
                    $('.phone_i').css('color' , '#4A708B');
                    $('.phone_i').removeClass('QK1 QK-cuohao QK-duihao-copy');
                    $('.phone_i').addClass('QK1 QK-f14');
                });
                $(this).keyup(function(){
                    $('.phone_i').css('color' , '#a94442');
                    $('.phone_i').removeClass('QK1 QK-f14 QK-duihao-copy');
                    $('.phone_i').addClass('QK1 QK-cuohao');
                });
            }
            if($(this).val().length != '0'){
                var str = $(this).val();//获取手机号
                //判断手机号格式是否正确
                function checkMobile(s) {
                    var regu = /^[1][0-9][0-9]{9}$/;
                    var re = new RegExp(regu);
                    if(re.test(s)){
//                        console.log('可以');
                        $('.phone_block2').css('display' , 'none');
                        $('#phone').parent().parent().removeClass('has-error');
                        $('#phone').parent().parent().addClass('has-success');
                        $('.phone_i').css('display' , 'block');
                        $(this).keydown(function(){
                            $('.phone_i').css('color' , '#4A708B');
                            $('.phone_i').removeClass('QK1 QK-cuohao QK-duihao-copy');
                            $('.phone_i').addClass('QK1 QK-f14');
                        });
                        $(this).keyup(function(){
                            $('.phone_i').css('color' , '#3c763d');
                            $('.phone_i').removeClass('QK1 QK-f14 QK-cuohao');
                            $('.phone_i').addClass('QK1 QK-duihao-copy');
                        });
                    }else{
//                        console.log('不可以');
                        $('.phone_block2').css('display' , 'block');
                        $(this).parent().parent().removeClass('has-success');
                        $('#phone').parent().parent().addClass('has-error');
                        $('.phone_i').css('display' , 'block');
                        $(this).keydown(function(){
                            $('.phone_i').css('color' , '#4A708B');
                            $('.phone_i').removeClass('QK1 QK-cuohao QK-duihao-copy');
                            $('.phone_i').addClass('QK1 QK-f14');
                        });
                        $(this).keyup(function(){
                            $('.phone_i').css('color' , '#a94442');
                            $('.phone_i').removeClass('QK1 QK-f14 QK-duihao-copy');
                            $('.phone_i').addClass('QK1 QK-cuohao');
                        })
                    }
                }
                checkMobile(str);
            }
        });
        //确认密码
        $('#repwd').bind('input propertychange', function() {
            $('.repwd_block1').css('display' , 'none');
            $('.repwd_block2').css('display' , 'none');
            $(this).parent().parent().removeClass('has-error');
            $(this).parent().parent().removeClass('has-success');
            if($(this).val().length == '0'){
                $('.repwd_block1').css('display' , 'block');
                $(this).parent().parent().addClass('has-error');
                $('.repwd_i').css('display' , 'block');
                $(this).keydown(function(){
                    $('.repwd_i').css('color' , '#4A708B');
                    $('.repwd_i').removeClass('QK1 QK-cuohao QK-duihao-copy');
                    $('.repwd_i').addClass('QK1 QK-f14');
                });
                $(this).keyup(function(){
                    $('.repwd_i').css('color' , '#a94442');
                    $('.repwd_i').removeClass('QK1 QK-f14 QK-duihao-copy');
                    $('.repwd_i').addClass('QK1 QK-cuohao');
                });
            }
            if($(this).val().length != '0'){
                var str = $(this).val();//获取确认密码
                var prev_str = $('#phone').val();//获取密码
                //判断确认密码是否正确
                if(str != prev_str){
                    $('.repwd_block2').css('display' , 'block');
                    $('#repwd').parent().parent().removeClass('has-success');
                    $('#repwd').parent().parent().addClass('has-error');
                    $('.repwd_i').css('display' , 'block');
                    $(this).keydown(function(){
                        $('.repwd_i').css('color' , '#4A708B');
                        $('.repwd_i').removeClass('QK1 QK-cuohao QK-duihao-copy');
                        $('.repwd_i').addClass('QK1 QK-f14');
                    });
                    $(this).keyup(function(){
                        $('.repwd_i').css('color' , '#a94442');
                        $('.repwd_i').removeClass('QK1 QK-f14 QK-duihao-copy');
                        $('.repwd_i').addClass('QK1 QK-cuohao');
                    })
                }else {
                    $('.repwd_block2').css('display' , 'none');
                    $('#repwd').parent().parent().removeClass('has-error');
                    $('#repwd').parent().parent().addClass('has-success');
                    $('.repwd_i').css('display' , 'block');
                    $(this).keydown(function(){
                        $('.repwd_i').css('color' , '#4A708B');
                        $('.repwd_i').removeClass('QK1 QK-cuohao QK-duihao-copy');
                        $('.repwd_i').addClass('QK1 QK-f14');
                    });
                    $(this).keyup(function(){
                        $('.repwd_i').css('color' , '#3c763d');
                        $('.repwd_i').removeClass('QK1 QK-f14 QK-cuohao');
                        $('.repwd_i').addClass('QK1 QK-duihao-copy');
                    });
                }
            }
        });
        //提交注册信息
        $('#register_button').click(function () {
            new_userName = '';
            new_phone = '';
            new_password = '';
            if($('#new_userName').val() == ''){
                $('#new_userName').parent().parent().addClass('has-error');
                $('.username_i').css('display' , 'block');
                $('.username_i').addClass('QK1 QK-cuohao');
                $('.help-block1').css('display' , 'block');
            }
            if($('#remail').val() == ''){
                $('#remail').parent().parent().addClass('has-error');
                $('.email_i').css('display' , 'block');
                $('.email_i').addClass('QK1 QK-cuohao');
                $('.email_block1').css('display' , 'block');
            }
            if($('#phone').val() == ''){
                $('#phone').parent().parent().addClass('has-error');
                $('.phone_i').css('display' , 'block');
                $('.phone_i').addClass('QK1 QK-cuohao');
                $('.phone_block1').css('display' , 'block');
            }
            if($('#pwd').val() == ''){
                $('#pwd').parent().parent().addClass('has-error');
                $('.pwd_i').css('display' , 'block');
                $('.pwd_i').addClass('QK1 QK-cuohao');
                $('.pwd_block1').css('display' , 'block');
            }
            if($('#repwd').val() == ''){
                $('#repwd').parent().parent().addClass('has-error');
                $('.repwd_i').css('display' , 'block');
                $('.repwd_i').addClass('QK1 QK-cuohao');
                $('.repwd_i').css('display' , 'block');
                $('.repwd_block1').css('display' , 'block');
            }
            new_array = [$('#new_userName') , $('#remail') , $('#phone') , $('#pwd') , $('#repwd')];
            //获取注册信息
            if($('#new_userName').next('i').hasClass('QK-cuohao')){
//                console.log('有错');
            }else{
                new_userName = $('#new_userName').val();
            }
            if($('#phone').next('i').hasClass('QK-cuohao')){
//                console.log('有错');
            }else{
                new_phone = $('#phone').val();
            }
            if($('#repwd').next('i').hasClass('QK-cuohao')){
//                console.log('有错');
            }else{
                new_password = $('#repwd').val();
            }
            if(new_userName != '' && new_phone != '' && new_password != '' && new_userName != undefined && new_phone != undefined && new_password != undefined){
//                console.log(new_password);
//                console.log(new_phone);
//                console.log(new_userName);
                $.ajax({
                    url:api + '/student/insert',
                    type:'post',
                    data:'para={"name":"'+new_userName+'","phone":"'+new_password+'"}',
                    success:function (result) {
                        if(result.message == 'Success'){
                            if(result.data.record == '账号已存在'){
//                                console.log('此账号已存在');
                                $('#myModal8').modal('hide');
                                var obj={
                                    type:"slideFromBottom",
                                    content:"<div>此用户已存在",
                                    btn:["","好的"]
                                };
                                method.msg_layer(obj);
                                $('.layer-commit').click(function () {
                                    $('#myModal8').modal('show');
                                });
                                $('.layer-close').click(function () {
                                    $('#myModal8').modal('show');
                                });
                                $('#phone').val("");
                                $('#repwd').val("");
                                $('#phone').parent().parent().removeClass('has-success');
                                $('#repwd').parent().parent().removeClass('has-success');
                                $('.repwd_i').css('display' , 'none');
                                $('.phone_i').css('display' , 'none');
                            }else{
//                                console.log("成功了");
                                $('#myModal8').modal('hide');
                                var obj2={
                                    type:"showSweetAlert",
                                    content:"<div>恭喜您！注册成功！",
                                    btn:["","OK"]
                                };
                                method.msg_layer(obj2);
                                $('#phone').val("");
                                $('#repwd').val("");
                                $('#new_userName').val("");
                                $('#phone').parent().parent().removeClass('has-success');
                                $('#repwd').parent().parent().removeClass('has-success');
                                $('#new_userName').parent().parent().removeClass('has-success');
                                $('.repwd_i').css('display' , 'none');
                                $('.phone_i').css('display' , 'none');
                                $('.username_i').css('display' , 'none');
                            }
                        }else{
                            var obj3={
                                type:"layerFadeIn",
                                close:"true",
                                content:"<div>系统错误",
                                btn:["取消",""]
                            };
                            method.msg_layer(obj3);
                            $('.layer-commit').remove();
                            $('#phone').val("");
                            $('#repwd').val("");
                            $('#phone').parent().parent().removeClass('has-success');
                            $('#repwd').parent().parent().removeClass('has-success');
                            $('.repwd_i').css('display' , 'none');
                            $('.phone_i').css('display' , 'none');
                        }
                    },
                    error:function () {
                        var obj={
                            type:"layerFadeIn",
                            close:"true",
                            content:"<div>系统错误",
                            btn:["取消",""]
                        };
                        method.msg_layer(obj);
                        $('.layer-commit').remove();
                        $('#phone').val("");
                        $('#repwd').val("");
                        $('#phone').parent().parent().removeClass('has-success');
                        $('#repwd').parent().parent().removeClass('has-success');
                        $('.repwd_i').css('display' , 'none');
                        $('.phone_i').css('display' , 'none');
                    }
                })
            }

        });
    })
</script>
<script>
    $(document).ready(function(){
        var storage = window.localStorage;
        var getName = storage["Name"];
        var getPwd = storage["password"];
        var getisstroepwd = storage["isstorePwd"];
        var isStudentRadio = storage["isStudentRadio"];
        var isTouristRadio = storage["isTouristRadio"];
//        console.log(getName);
//        console.log(getPwd);
//        console.log(getisstroepwd);
        if(getisstroepwd == "yes") {
            $(".text_input").val(getName);
            $(".password").val(getPwd);
            $("#checkbox").prop('checked' , true);
        }else{
            $(".text_input").val(getName);
        }
        if(isStudentRadio == 'yes'){
            $("#radio1").prop('checked' , true);
            $("#radio2").prop('checked' , false);
        }else{
            $("#radio1").prop('checked' , false);
            $("#radio2").prop('checked' , true);
        }
        $('#btn_submit').click(function () {
            var userName=$(".text_input").val();
            var userPassWord=$(".password").val();
            NProgress.start();
            NProgress.inc();
            //记住密码
            var storage = window.localStorage;
            if($("#checkbox").prop('checked') == true) {
                //存储到loaclStage
                storage["Name"] = userName;
                storage["password"] = userPassWord;
                storage["isstorePwd"] = "yes";
            }else{
                storage["Name"] = userName;
                storage["isstorePwd"] = "no";
            }
            if($("#radio1").prop('checked') == true) {
                //存储到loaclStage
                storage["isStudentRadio"] = "yes";
                storage["isTouristRadio"] = "no";
            }else{
                storage["isStudentRadio"] = "no";
                storage["isTouristRadio"] = "yes";
            }
            if(userName == ''){
                NProgress.done(true);
                var obj={
                    type:"layerFadeIn",
                    close:"true",
                    content:"<div>账号不能为空",
                    btn:["明白",""]
                };
                method.msg_layer(obj);
                $('.layer-commit').remove();
            }
            if(userPassWord == ''){
                NProgress.done(true);
                var obj={
                    type:"layerFadeIn",
                    close:"true",
                    content:"<div>密码不能为空",
                    btn:["明白",""]
                };
                method.msg_layer(obj);
                $('.layer-commit').remove();
            }
            if(userPassWord == '' && userName == ''){
                NProgress.done(true);
                var obj={
                    type:"layerFadeIn",
                    close:"true",
                    content:"<div>账号密码不能为空",
                    btn:["","我傻"]
                };
                method.msg_layer(obj);
            }
            if(userName != '' && userPassWord != '' && $("#radio1").prop('checked') == true){
                $.ajax({
                    type:'post',
                    url:api + '/student/studentLogin',
                    data:'para={"username":"'+userName+'","passwd":"'+userPassWord+'"}',
                    success:function(result) {
//                    console.log(result);
                        if(result.message == "Success"){
//                        console.log('成功');
                            var userId = result.data.record.sid;
                            var classId = result.data.record.cid;
                            var user_name = result.data.record.name;
                            storage["uid"] = userId;
                            storage["class_id"] = classId;
                            storage["user_name"] = user_name;
                            storage["pw"] = userPassWord;
                            NProgress.done(true);
                            window.location.href='index.html';
                        }else{
//                        console.log("账号密码错误");
                            var obj={
                                type:"layerFadeIn",
                                close:"true",
                                content:"<div>此账号为游客账号",
                                btn:["取消",""]
                            };
                            method.msg_layer(obj);
                            $('.layer-commit').remove();
                            $('.layer-cancel').click(function () {
                                NProgress.done(true);
                            });
                            $('.layer-close').click(function () {
                                NProgress.done(true);
                            });
                        }

                    },
                    error:function() {
                        var obj={
                            type:"layerFadeIn",
                            close:"true",
                            content:"<div>系统错误",
                            btn:["取消",""]
                        };
                        method.msg_layer(obj);
                        $('.layer-commit').remove();
                        $('.layer-cancel').click(function () {
                            NProgress.done(true);
                        });
                        $('.layer-close').click(function () {
                            NProgress.done(true);
                        });
                    }
                });
            }else if(userName != '' && userPassWord != '' && $("#radio2").prop('checked') == true){
                $.ajax({
                    type:'post',
                    url:api + '/student/touristLogin',
                    data:'para={"username":"'+userName+'","password":"'+userPassWord+'"}',
                    success:function(result) {
//                    console.log(result);
                        if(result.message == "Success"){
//                        console.log('成功');
                            var userId = result.data.record.sid;
                            var user_name = result.data.record.name;
                            storage["uid"] = userId;
                            storage["user_name"] = user_name;
                            storage["pw"] = userPassWord;
                            NProgress.done(true);
                            window.location.href='index.html';
                        }else{
//                        console.log("账号密码错误");
                            var obj={
                                type:"layerFadeIn",
                                close:"true",
                                content:"<div>此账号为学生账号",
                                btn:["取消",""]
                            };
                            method.msg_layer(obj);
                            $('.layer-commit').remove();
                            $('.layer-cancel').click(function () {
                                NProgress.done(true);
                            });
                            $('.layer-close').click(function () {
                                NProgress.done(true);
                            });
                        }

                    },
                    error:function() {
                        var obj={
                            type:"layerFadeIn",
                            close:"true",
                            content:"<div>系统错误2",
                            btn:["取消",""]
                        };
                        method.msg_layer(obj);
                        $('.layer-commit').remove();
                        $('.layer-cancel').click(function () {
                            NProgress.done(true);
                        });
                        $('.layer-close').click(function () {
                            NProgress.done(true);
                        });
                    }
                });
            }

        });
    });
</script>
